﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExtLogin.aspx.cs" Inherits="ZP.Web.Admin.ExtLogin" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Login - Expro</title>    
    <style type="text/css">
        h1 {
            font: normal 60px tahoma, arial, verdana;
            color: #E1E1E1;
        }
        
        h2 {
            font: normal 20px tahoma, arial, verdana;
            color: #E1E1E1;
        }
        
        h2 a {
            text-decoration: none;
            color: #E1E1E1;
        }
        
        .x-window-mc {
            background-color : #F4F4F4 !important;
        }
    </style>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" Theme="Gray" runat="server" />
    
    <h1>Northwind Traders</h1>
    <h2>Powered by <a href="http://www.ext.net/">Ext.NET</a>, <a href="http://www.extjs.com/">ExtJS</a> and <a href="http://www.asp.net/mvc/">ASP.NET MVC</a></h2>
    <ext:Window ID="LoginWindow" runat="server" Closable="false" Resizable="false" Height="170" Icon="Lock" Title="登录" Width="300" Modal="true" Layout="Fit" BodyBorder="false" Padding="5" Draggable="False">        
        <Items>
            <ext:FormPanel ID="FormPanel1" MonitorValid="true" runat="server" FormID="form1" Border="false" Layout="form" BodyBorder="false" BodyStyle="background:transparent;" LabelWidth="70" >
                <Items>
                    <ext:TextField ID="txtUsername" runat="server" FieldLabel="ID" AllowBlank="false" BlankText="用户名不能为空" Text="admin@1.c" AnchorHorizontal="100%" />
                    <ext:TextField ID="txtPassword" runat="server" InputType="Password" FieldLabel="密码" AllowBlank="false" BlankText="密码不能为空" Text="111111" AnchorHorizontal="100%" />
                    <ext:Container runat="server" Layout="Column" Height="23" FieldLabel="验证码">
                    <Items>
                    <ext:Container runat="server" Layout="Column" ColumnWidth=".5">
                    <Items>
                        <ext:TextField ID="txtCode" runat="server" MaxLength="4" AllowBlank="false" Width="80" />
                        <ext:Label Width="5" runat="server" />
                        <ext:Image ID="btnVerify" Width="50" runat="server">
                            <DirectEvents>
                                <Click OnEvent="btnVerify_Click" />
                            </DirectEvents>
                        </ext:Image>
                    </Items>
                    </ext:Container>
                    </Items>
                    </ext:Container>
                    <ext:Checkbox ID="txtRemember" runat="server" BoxLabel="自动登录" />
                </Items>
                <Listeners>
                    <ClientValidation Handler="#{btnLogin}.setDisabled(!valid);" />
                </Listeners>
            </ext:FormPanel>
        </Items>
        <Buttons>
            <ext:Button ID="btnLogin" runat="server" Text="登录" Icon="Accept">
                <DirectEvents>
                    <Click OnEvent="btnLogin_Click" Timeout="60000" FormID="form1" CleanRequest="true" Method="POST" Before="Ext.Msg.wait('验证中...', '登录');" Failure="Ext.MessageBox.alert('系统提示', response.statusText);">
                        <EventMask Target="CustomTarget" CustomTarget="={#{LoginWindow}.body}" ShowMask="True" />
                    </Click>
                </DirectEvents>
            </ext:Button>
        </Buttons>
        <KeyMap>
            <ext:KeyBinding>
                <Keys>
                    <ext:Key Code="ENTER" />
                </Keys>
                <Listeners>
                    <Event Handler="#{btnLogin}.fireEvent('click');" />
                </Listeners>
            </ext:KeyBinding>
        </KeyMap>
    </ext:Window>
</body>
</html>